<template>
  <svg :style="{ width, height }">
    <use :xlink:href="svgUrl" :color="color"></use>
  </svg>
</template>
<script setup lang="ts">
import { computed } from "vue";
const props = defineProps({
  // xlink:href前缀
  prefix: {
    type: String,
    default: "#icon-",
  },
  // 图标名称
  name: String,
  // 颜色
  color: String,
  width: {
    type: String,
    default: "16px",
  },
  height: {
    type: String,
    default: "16px",
  },
});
const svgUrl = computed(() => props.prefix + props.name);
</script>
<style scoped></style>
